{% extends '@WebsiteBundle/layout/layout.html.twig' %}
{% import "@WebsiteBundle/macros/pagination.html.twig" as macros %}
 {% block page %}
   {{ parent() }}
   <div id="main" class="commonMain">
      <div class="layui-main">
        <div class="centerHeader">
          {%  if brands %}
            <div class="centerCard">
              <a href="{{ path('app_detail_center',{categoryId:0, isFree:isFree}) }}" class="{% if firstId == 0   %} layui-btn layui-btn-normal layui-btn-xs {% endif %}">全部</a>
              {% for v in brands %}
                <a href="{{ path('app_detail_center', {categoryId:v['id'], isFree:isFree}) }}" class="{% if firstId == v['id']   %} layui-btn layui-btn-normal layui-btn-xs {% endif %}">{{ v['name'] }}</a>
              {% endfor %}
            </div>
          {% endif %}

          {% if secondSubCategorys %}
            <div class="centerCard">
              <a href="{{ path('app_detail_center', {categoryId:firstId, isFree:isFree}) }}" class="{% if secondId == 0 %} layui-btn layui-btn-normal layui-btn-xs {% endif %}">全部</a>
              {% for sv in secondSubCategorys %}
                <a class="{% if secondId == sv['id']   %} layui-btn layui-btn-normal layui-btn-xs {% endif %}" href="{{ path('app_detail_center', {categoryId:sv['id'],isFree:isFree}) }}">{{ sv['name'] }}</a>
              {% endfor %}
            </div>
          {% endif %}

          {% if threeSubCategory %}
            <div class="centerCard">
              <a href="{{ path('app_detail_center', {categoryId:secondId, isFree:isFree}) }}" class="{% if threeId == 0   %} layui-btn layui-btn-normal layui-btn-xs {% endif %}">全部</a>
              {% for thv in threeSubCategory %}
                <a class="{% if threeId == thv['id']   %} layui-btn layui-btn-normal layui-btn-xs {% endif %}" href="{{ path('app_detail_center', {categoryId:thv['id'], isFree:isFree}) }}">{{ thv['name'] }}</a>
              {% endfor %}
            </div>
          {% endif %}

          <div class="centerCard">
              <a href="{{ path('app_detail_center', {categoryId:categoryId, isFree:0}) }}" class="{% if isFree == 0 %} layui-btn layui-btn-normal layui-btn-xs {% endif %}">全部</a>
              <a href="{{ path('app_detail_center', {categoryId:categoryId, isFree:1}) }}" class="{% if isFree == 1 %} layui-btn layui-btn-normal layui-btn-xs {% endif %}">免费</a>
              <a href="{{ path('app_detail_center', {categoryId:categoryId, isFree:2}) }}" class="{% if isFree == 2 %} layui-btn layui-btn-normal layui-btn-xs {% endif %}">收费</a>
          </div>
        </div>
          <div class="mainBox">
              <div class="content">
          {% if list is empty %}
            <div class="layui-center">
              <img src="/bundles/eduxpluswebsite/default/images/null-i2.png"  class="blank-img" >
              <div>还没有当前专业的课程哦～</div>
            </div>
          {% else %}
              <ul class="layui-row layui-col-space10">
                {% for v in  list %}
                  <div class="layui-col-md3">
                    <a href="{{ path('app_detail_index', {uuid:v['uuid']}) }}" class="gooda">
                      <div class="goodCard ">
                        <div class="goodCover">
                          <img src="{% if v['goodsSmallImg'] %} {{ json_get(v['goodsSmallImg']) }} {% else %} /bundles/eduxpluswebsite/images/course.jpg {% endif %}" />
                        </div>
                        <div class="goodInfo">
                          <div class="goodTitle">{{ v['name'] }}</div>
                          {% if v['tagsArr'] %}
                          <div class="goodTags">
                                {% for tv in  v['tagsArr'] %}
                                  {% if tv %}
                                  <span class="layui-badge layui-bg-gray">{{ tv }}</span>
                                  {% endif %}
                                {% endfor %}
                          </div>
                          {% endif %}
                          <div class="goodAttr">
                            <span class="goodPrice">{% if v['shopPrice'] >0 %}¥{{ v['shopPriceView'] }} {% else %} 免费 {% endif %}</span>
                            <span class="buyNum">{{ v['buyNumberFalse'] }}人购买</span>
                          </div>
                        </div>
                      </div>
                    </a>
                  </div>
                {% endfor %}
              </ul>
          {% endif %}
          {{ macros.pagination(pagination) }}
        </div>
          </div>
       </div>
   </div>
 {% endblock %}
